<?php 
class Constant {
    /* config ldap server */
    const LDAP_HOST = "gemdc01.gemtechlab.ch"; // Active Directory server
    const LDAP_DN = "OU=GemTechLab,DC=gemtechlab,DC=ch"; // Active Directory DN
    const LDAP_USER_GROUP = "Intranet Users"; // Active Directory user group
    const LDAP_MANAGER_GROUP = "Intranet Admin"; // Active Directory manager group
    const LDAP_USER_DOM = "@gemtechlab.ch"; // Domain, for purposes of constructing $user

    const ROLE_ADMIN = 1;
    const ROLE_ANALYST = 2;
    const PREFIX_PASS = 'TarekHoanx';

    const STATUS_PENDING = 1;
    const STATUS_CLOSE = 2;

    const STATUS_COMPLATE = 3;
    const STATUS_INCOMPLATE = 4;

    const BY_CLIENT_COMPANY = 1;
    const BY_CONTACT_PERSON = 2;
    const BY_MATTER = 3;

    const STATUS_SHIP_PENDING = 0;
    const STATUS_SHIP_SHIPED = 1;
    const STATUS_SHIP_CANCEL = 2;

    const IMG_WIDTH_SIGNATURE = 300;
    const IMG_HEIGHT_SIGNATURE = 100;

    const FORMAT_DATE = 'd/m/Y';

    const OZEKI_USER = "admin";
    const OZEKI_PASSWORD = "GemTech_SMS2013";
    const OZEKI_URL = "http://127.0.0.1:9501/api?";

    static function getStatus($status=null){
        $result = array(
            self::STATUS_PENDING => Yii::t('app', 'Pending'),
            self::STATUS_COMPLATE => Yii::t('app', 'Complate'),
            self::STATUS_INCOMPLATE => Yii::t('app', 'Incomplate'),
            self::STATUS_CLOSE => Yii::t('app', 'Closed'),
        );
        if(!is_null($status)){
            return (isset($result[$status]) ? $result[$status] : Yii::t('app', 'No status'));
        }
        return $result;
    }

    static function getStatusUser(){
        return array(
            self::STATUS_COMPLATE => Yii::t('app', 'Complate'),
            self::STATUS_PENDING => Yii::t('app', 'Pending'),
        );
    }

    static function getStatusStep(){
        return array(
            self::STATUS_PENDING => Yii::t('app', 'Pending'),
            self::STATUS_CLOSE => Yii::t('app', 'Closed'),
        );
    }

    static function getStatustag($status=null){
        $result = array(
            self::STATUS_PENDING => 'pending',
            self::STATUS_COMPLATE => 'complate',
            self::STATUS_INCOMPLATE => 'incomplate',
            self::STATUS_CLOSE => 'closed',
        );
        if(!is_null($status)){
            return (isset($result[$status]) ? $result[$status] : 'none');
        }
        return $result;
    }

    static function getUpdateStatusBy($by=null){
        $result =  array(
            self::BY_CLIENT_COMPANY => Yii::t('app', 'The client company'),
            self::BY_CONTACT_PERSON => Yii::t('app', 'The contact person'),
            self::BY_MATTER => Yii::t('app', 'The matter name'),
        );
        if($by && $result[$by]){
            return $result[$by];
        }
        return $result;
    }

}